home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 125
/
MOBICLIC 125.ISO
/
pc
/
DATA
/
HOTE
/
prod_gen_XB
/
moteur.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-06-15
|
15KB
|
533 lines
function gimme2digits(X)
{
if(Number(X) < 10)
{
lX = "0" + Number(X);
}
else
{
lX = String(X);
}
return lX;
}
function gimme3digits(X)
{
if(Number(X) < 10)
{
lX = "00" + Number(X);
}
else if(Number(X) < 100)
{
lX = "0" + Number(X);
}
else
{
lX = String(X);
}
return lX;
}
function randomValue(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
function InitMascotte(p)
{
trace("InitMascotte " + this);
var _loc3_ = this.MediasExternes[p.mc._name].ParamsXml;
var _loc4_ = p.mc;
_loc4_.ParamsXml = this.MediasExternes[_loc4_._name].ParamsXml;
trace("this.MediasExternes : " + _root.MediasExternes);
trace("mascotte._name : " + _loc4_._name);
trace("this.MediasExternes[mascotte._name].ParamsXml : " + this.MediasExternes[_loc4_._name].ParamsXml);
trace("this.MediasExternes[mascotte._name] : " + this.MediasExternes[_loc4_._name]);
_loc4_._x = _loc3_.x != undefined ? _loc3_.x : 0;
trace("params_xml.x : " + _loc3_.x);
_loc4_._y = _loc3_.y != undefined ? _loc3_.y : 0;
trace("params_xml.y : " + _loc3_.y);
_loc4_._xscale = _loc3_.scale != undefined ? Number(_loc3_.scale) : 100;
trace("params_xml.scale : " + _loc3_.scale);
_loc4_._yscale = _loc3_.scale != undefined ? Math.abs(Number(_loc3_.scale)) : 100;
trace("params_xml.scale : " + _loc3_.scale);
return _loc4_;
}
function afficherMascottes(mascottes)
{
var _loc2_ = 0;
while(_loc2_ < _root.MASCOTTES_LISTE.length)
{
_root.MASCOTTES_LISTE[_loc2_]._visible = false;
_root.MASCOTTES_LISTE[_loc2_].ETAT = "E2";
_loc2_ = _loc2_ + 1;
}
if(mascottes != undefined)
{
var _loc4_ = undefined;
_loc2_ = 0;
while(_loc2_ < mascottes.length)
{
_loc4_ = _root["MASC_" + mascottes[_loc2_].nom];
_loc4_.ETAT = mascottes[_loc2_].action;
trace("mascottes[i].action : " + mascottes[_loc2_].action);
_loc4_.gotoAndStop(mascottes[_loc2_].action);
_root.InitMascotte({mc:_loc4_});
_loc4_._visible = true;
_loc2_ = _loc2_ + 1;
}
}
}
function testeDebutCommentSpecial()
{
var _loc2_ = _root.gCommentOn.id.split("_")[_root.gCommentOn.id.split("_").length - 1];
switch(_loc2_)
{
case "bz":
case "BZ":
trace("------- BZ on-----------");
_root.DesactiveOEIL();
if(_root.BT_OEIL.gEtat !== 3)
{
trace("E3");
_root.BT_OEIL.gotoAndPlay("E3");
}
else
{
trace("PARLE");
_root.BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
break;
case "ze":
case "ZE":
trace("------- ZE on-----------");
_root.DesactiveOEIL();
if(_root.BT_OEIL.gEtat !== 3)
{
_root.BT_OEIL.gotoAndPlay("E3");
}
else
{
_root.BT_OEIL.OEIL_P.gotoAndPlay("parle");
}
_root.afficherRolls();
break;
case "sp":
case "SP":
trace("------- SP on-----------");
_root.MASCOTTE_SPAM.gotoAndStop("E1");
_root.MASCOTTE_SPAM._visible = true;
break;
case "wk":
case "WK":
trace("------- WK on-----------");
trace("------- MASCOTTE_WIKI-----------");
_root.MASCOTTE_WIKI.gotoAndStop("E1");
_root.MASCOTTE_WIKI._visible = true;
break;
case "bg":
case "BG":
trace("------- BG on-----------");
_root.MASCOTTE_BUG.gotoAndStop("E1");
_root.MASCOTTE_BUG._visible = true;
}
}
function testeFinCommentSpecial()
{
var _loc2_ = _root.gCommentOn.id.split("_")[_root.gCommentOn.id.split("_").length - 1];
switch(_loc2_)
{
case "bz":
case "BZ":
trace("------- BZ off-----------");
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
break;
case "ze":
case "ZE":
trace("------- ZE off-----------");
_root.ActiveOEIL();
_root.BT_OEIL.OEIL_P.gotoAndPlay("rentre");
_root.BT_OEIL.gClicOn = undefined;
_root.masquerRolls();
break;
case "sp":
case "SP":
trace("------- SP off-----------");
_root.MASCOTTE_SPAM.gotoAndStop("E2");
if(_root.MASCOTTE_SPAM.CacherApres != false)
{
_root.MASCOTTE_SPAM._visible = false;
}
break;
case "wk":
case "WK":
trace("------- WK off-----------");
_root.MASCOTTE_WIKI.gotoAndStop("E2");
if(_root.MASCOTTE_WIKI.CacherApres != false)
{
_root.MASCOTTE_WIKI._visible = false;
}
break;
case "bg":
case "BG":
trace("------- BG off-----------");
_root.MASCOTTE_BUG.gotoAndStop("E2");
if(_root.MASCOTTE_BUG.CacherApres != false)
{
_root.MASCOTTE_BUG._visible = false;
}
}
}
function activePause()
{
trace("paused ?");
activePauseSons();
activePauseClip(gClipGen);
activePauseInterval();
}
function activePauseSons()
{
trace("active pause");
if(gCommentOn !== undefined)
{
gCommentOnPause = gCommentOn;
gCommentOnPause.p = gCommentOn.p;
xtrace("++++++++ " + gCommentOn.p);
gCommentOnPausePos = gCommentOn.position;
stopComment();
}
if(gListeBruitage !== undefined)
{
gListePosBruitage = [];
gListeBruitageP = [];
i = gListeBruitage.length - 1;
while(i >= 0)
{
var _loc1_ = gListePosBruitage.push[soundObjects[gBruitageName + gListeBruitage[i]].position];
gListeBruitageP.push[soundObjects[gBruitageName + gListeBruitage[i]].p];
stopBruitage(soundObjects[gBruitageName + gListeBruitage[i]].p);
i--;
}
}
if(gMusicOn)
{
gPosMusic = soundObjects[gMusic].position;
soundObjects[gMusic].stop();
}
}
function desactivePause()
{
desactivePauseSons();
desactivePauseClip();
desactivePauseInterval();
}
function desactivePauseSons()
{
if(gCommentOnPausePos !== undefined)
{
if(gCommentOnPause.duration / 1000 !== gCommentOnPausePos / 1000)
{
joueSon(gCommentOnPause.p);
}
}
if(gMusicOn)
{
soundObjects[gMusic].start(0,2000);
gPosMusic = undefined;
}
}
function findClipAnimRecursive(lClip, ListeClipAnim)
{
for(var _loc3_ in lClip)
{
if(typeof lClip[_loc3_] == "movieclip")
{
if(getPos(gListeClipPause,lClip[_loc3_]) == -1)
{
gListeClipPause.push(lClip[_loc3_]);
gListeClipPauseFrame.push(lClip[_loc3_]._currentframe);
var _loc2_ = lClip[_loc3_];
findClipAnimRecursive(_loc2_);
}
}
}
}
function compareClipFrame(lClip)
{
var _loc1_ = 0;
while(_loc1_ < gListeClipPause.length)
{
if(gListeClipPauseFrame[_loc1_] == gListeClipPause[_loc1_]._currentframe)
{
gListeClipPauseJoueur.push(0);
}
else
{
trace(gListeClipPause[_loc1_] + " _ " + gListeClipPauseFrame[_loc1_] + " _ " + gListeClipPause[_loc1_]._currentframe);
gListeClipPauseJoueur.push(1);
}
gListeClipPause[_loc1_].gotoAndStop(gListeClipPauseFrame[_loc1_]);
_loc1_ = _loc1_ + 1;
}
}
function activePauseClip(lClip)
{
gListeClipPause = [];
gListeClipPauseFrame = [];
gListeClipPauseJoueur = [];
lClip.pFrame = 0;
lClip.onEnterFrame = function()
{
this.pFrame += 1;
switch(this.pFrame)
{
case 1:
findClipAnimRecursive(this);
break;
case 2:
compareClipFrame(this);
delete this.onEnterFrame;
mcPause = creerRectangle({nom:"mcPause",pere:_root,level:15001,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
mcPause.useHandCursor = false;
mcPause.onPress = function()
{
};
}
};
}
function desactivePauseClip()
{
var _loc1_ = 0;
while(_loc1_ < gListeClipPause.length)
{
if(gListeClipPauseJoueur[_loc1_] == 1)
{
gListeClipPause[_loc1_].gotoAndPlay(gListeClipPauseFrame[_loc1_]);
}
else
{
gListeClipPause[_loc1_].gotoAndStop(gListeClipPauseFrame[_loc1_]);
}
_loc1_ = _loc1_ + 1;
}
gListeClipPause = undefined;
gListeClipPauseFrame = undefined;
gListeClipPauseJoueur = undefined;
}
function spacePause()
{
if(gPauseOn == undefined)
{
trace("PAUSE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
activePause();
gPauseOn = 1;
}
else
{
trace("ARRETE LA PAUSE !!!!!!!!!!!!!!!!!!!!! ");
removeMovieClip(mcPause);
desactivePause();
gPauseOn = undefined;
}
}
function playClipAnim(lClip)
{
playClipAnimRecursive(lClip,[]);
}
this.CIBLE = _root;
_global.gimme2digits = gimme2digits;
_global.gimme3digits = gimme3digits;
_global.randomValue = randomValue;
_root.InitMascotte = InitMascotte;
_root.afficherMascottes = afficherMascottes;
var CIBLE = _root;
this.xPauseOn = function()
{
trace("xPauseOn " + this + " " + _global.pauseComment);
_global.pauseComment();
this.moteur.PauseMCs = [];
this.moteur.xPause_rec({clipref:_root});
};
this.xPauseOff = function()
{
trace("xPauseOff " + this);
this.moteur.PauseDesactive();
_global.continueComment();
};
this.PAUSEINTFUNC = function()
{
var _loc3_ = getTimer();
if(_loc3_ - this.firstTime >= 100)
{
clearInterval(this.PAUSEINT);
this.xPause_rec2({clipref:_root});
}
};
this.xPause_rec = function(p)
{
for(prop in p.clipref)
{
if(typeof p.clipref[prop] == "movieclip" && p.clipref[prop] != _root && p.clipref[prop].NoPause != true)
{
p.clipref[prop].DetectFrameFirst = p.clipref[prop]._currentframe;
this.xPause_rec({clipref:p.clipref[prop]});
}
}
if(p.clipref == _root)
{
this.firstTime = getTimer();
this.PAUSEINT = setInterval(this,"PAUSEINTFUNC",10);
}
};
this.xPause_rec2 = function(p)
{
for(prop in p.clipref)
{
if(typeof p.clipref[prop] == "movieclip" && p.clipref[prop] != _root && p.clipref[prop].NoPause != true)
{
p.clipref[prop].DetectFrameLast = p.clipref[prop]._currentframe;
if(p.clipref[prop].DetectFrameLast != p.clipref[prop].DetectFrameFirst)
{
this.PauseMCs.push(p.clipref[prop]);
}
this.xPause_rec2({clipref:p.clipref[prop]});
}
}
if(p.clipref == _root)
{
this.PauseActive();
}
};
this.PauseActive = function()
{
trace("PAUSEACTIVE " + this.PauseMCs.length);
for(prop in this.PauseMCs)
{
trace(this.PauseMCs[prop]);
this.PauseMCs[prop].stop();
}
};
this.PauseDesactive = function()
{
trace("PAUSEDESACTIVE " + this.PauseMCs.length);
for(prop in this.PauseMCs)
{
trace(this.PauseMCs[prop]);
this.PauseMCs[prop].play();
}
};
this.CIBLE = _root;
if(_global.gDataPath == undefined)
{
_global.gDataPath = "../../";
}
this.ChargeMoteur = function(p)
{
_root.moduleXmlRoot = _global.moduleXmlRoot;
trace("_ChargeMoteur() - Chargement du moteur (prod/moteur/main.as)" + _root);
_root.gModulePath = GetFilePath(this.CIBLE._url) + "/";
trace("_root.gModulePath : " + _root.gModulePath);
if(!_root.moduleOnline)
{
_root.XmlStocker = new XML();
_root.XmlStocker.ignoreWhite = true;
_root.XmlStocker.load(_root.gModulePath + "localConfig.xml");
_root.XmlStocker.onLoad = _root.onlocalConfigLoaded;
}
else
{
_root.Main();
}
};
_root.ChargeMoteur = this.ChargeMoteur;
this.CIBLE.onlocalConfigLoaded = function(success)
{
trace("onlocalConfigLoaded " + this);
if(success)
{
_root.moduleXmlRoot = _root.gModulePath + this.firstChild.attributes.src;
_root.Main();
}
};
this.CIBLE.Main = function()
{
trace(this.CIBLE);
this.CIBLE.moduleInfo = _root.moduleInfo = new prod.moteur.V000xb_ChargementXML(this.CIBLE,_root.moduleXmlRoot,_root.moduleOnline);
};
this.CIBLE.xmlLoaded = function()
{
trace("__xmlLoaded() " + this.CIBLE);
_global.HOTE.LoadingProgress(70);
this.initGen();
this.gModuleName = this.moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.id;
this.gCommentName = "S_" + this.gLangue + "_" + this.gModuleName + "_";
this.gBruitageName = "B_" + this.gModuleName + "_";
this.gImagesPath = this.gModulePath + "/I_" + this.gModuleName;
var _loc3_ = this.gModuleName.split("_");
this.gModuleNumber = Number(_loc3_[_loc3_.length - 1]);
trace("this.gModuleNumber : " + this.gModuleNumber);
this.gRubriqueName = _loc3_[0].substr(0,3);
trace("this.gRubriqueName : " + this.gRubriqueName);
this.gCdName = _loc3_[0].substr(3,3);
trace("this.gCdName : " + this.gCdName);
this.mediaChargeur = new prod.moteur.V006_ChargementMedias(this.CIBLE,this.CIBLE.moduleInfo,this.CIBLE.moduleOnline);
this.gereTextes = new prod.moteur.V014_GereTextes(this.CIBLE,this.CIBLE.moduleInfo);
};
this.CIBLE.mediaLoaded = function()
{
if(typeof this.mediaChargeur == "undefined")
{
this.OnlySoundExterneHack = setInterval(this,"mediaLoaded",20);
}
else
{
trace("__mediaLoaded()");
this.soundObjects = this.mediaChargeur.returnSoundObject();
clearInterval(this.OnlySoundExterneHack);
this.initModule();
}
};
this.CIBLE.initModule = function()
{
trace("__initModule()" + this.CIBLE + " _ " + this.CIBLE.initVariables);
_global.HOTE.LoadingProgress(90);
this.CIBLE.initVariables();
};
_root.initKeyPause = function()
{
gPauseOn = 0;
gPauseSpaceOn = 0;
gPauseSpaceEnCours = 0;
};
_root.initGen = function()
{
_root.gClipGen = _global.gClipGen = this;
trace("______________________________ " + this);
Stage.showMenu = false;
this.gLangue = "FR";
this.gMusicOn = 1;
this.gSousTitre = 0;
this.gST = 0;
this.gVolume = 100;
this.gWidth = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.width;
this.gHeight = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.height;
if(this.gWidth == undefined)
{
this.gWidth = 800;
}
else
{
this.gWidth = Number(this.gWidth);
}
if(this.gHeight == undefined)
{
this.gHeight = 600;
}
else
{
this.gHeight = Number(this.gHeight);
}
initKeyPause();
};
stop();